<?php
//$url = isset($_POST['url']) ? urlencode($_POST['url']) : 'printer.php';
//$content = file_get_contents($url);
$content = '';

$handle = fopen('http://localhost/sandbox/triangle/', 'r');
while(!feof($handle)){
    $content .= fgets($handle);
}

//echo $content;

require './html2pdf/html2pdf.class.php';

try{
    $html2pdf = new HTML2PDF('L', 'A4', 'fr');
    $html2pdf->pdf->SetDisplayMode('fullpage');
    $html2pdf->writeHTML($content);
    $html2pdf->Output('export.pdf');
} catch (HTML2PDF_exception $ex) {
    echo $ex;
    exit;
}
